package com.youth.oauth.commons.beans;

import lombok.Data;

@Data
public class Result {

    private int code = 200;

    private String msg = "OK";

    private Object data;


    public Result() {
    }

    public static Result ok() {
        return new Result();
    }

    public static Result ok(Object data) {
        return new Result(data);
    }
    public static Result ok(String msg) {
        return new Result(200, msg);
    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(Object data) {
        this.data = data;
    }

    public static Result error(String msg) {
        return new Result(-1, msg);
    }
}
